package com.xnyzc.lhy.didi.controller.operation;

import com.xnyzc.lhy.common.entity.DiDiRv;
import com.xnyzc.lhy.didi.entity.param.operation.BillRefundParam;
import com.xnyzc.lhy.didi.entity.param.operation.CloseOrderParam;
import com.xnyzc.lhy.didi.entity.param.operation.FreeChargeParam;
import com.xnyzc.lhy.didi.entity.param.order.OrderDetailParam;
import com.xnyzc.lhy.didi.entity.param.synchronization.ChangePriceParam;
import com.xnyzc.lhy.didi.service.operation.CustomerServiceOperationService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 客服操作相关
 * </p>
 *
 * @author wangshuo
 * @since 2019-10-06
 */
@RestController
@RequestMapping("oa/didi/operation")
public class CustomerServiceOperationController {

    @Autowired
    private CustomerServiceOperationService customerServiceOperationService;

    /**
     * 客服取消订单，调用滴滴的关闭订单接口。
     *
     * @param cancelOrderParam
     * @return
     */
    @ApiOperation(value = "客服取消订单", notes = "客服取消订单")
    @PostMapping(value = "/getCancelOrder")
    public DiDiRv getCancelOrder(@ApiParam(name =
            "cancelOrderParam", value = "客服取消订单") @RequestBody CloseOrderParam cancelOrderParam) {
        return customerServiceOperationService.getCancelOrder(cancelOrderParam);
    }

    /**
     * 客服关单
     *
     * @param closeOrderParam
     * @return
     */
    @ApiOperation(value = "客服关单", notes = "客服关单")
    @PostMapping(value = "/getCloseOrder")
    public DiDiRv getCloseOrder(@ApiParam(name =
            "closeOrderParam", value = "客服关单") @RequestBody CloseOrderParam closeOrderParam) {
        return customerServiceOperationService.getCloseOrder(closeOrderParam);
    }

    /**
     * 直接调用滴滴客服关单
     *
     * @param closeOrderParam
     * @return
     */
    @ApiOperation(value = "直接调用滴滴客服关单", notes = "直接调用滴滴客服关单")
    @PostMapping(value = "/getCloseOrderDidiError")
    public DiDiRv getCloseOrderDidiError(@ApiParam(name =
            "closeOrderParam", value = "客服关单") @RequestBody CloseOrderParam closeOrderParam) {
        return customerServiceOperationService.getCloseOrderDidiError(closeOrderParam);
    }

    /**
     * 改价
     *
     * @param changePriceParam
     * @return
     */
    @ApiOperation(value = "改价", notes = "改价")
    @PostMapping(value = "/getChangePrice")
    public DiDiRv getChangePrice(@ApiParam(name =
            "changePriceParam", value = "改价") @RequestBody ChangePriceParam changePriceParam) {
        return customerServiceOperationService.getChangePrice(changePriceParam);
    }

    /**
     * 免单接口
     *
     * @param freeChargeParam
     * @return
     */
    @ApiOperation(value = "免单接口", notes = "免单接口")
    @PostMapping(value = "/getFreeCharge")
    public DiDiRv getFreeCharge(@ApiParam(name =
            "freeChargeParam", value = "免单接口") @RequestBody FreeChargeParam freeChargeParam) {
        return customerServiceOperationService.getFreeCharge(freeChargeParam);
    }

    /**
     * 退款接口
     *
     * @param billRefundParam
     * @return
     */
    @ApiOperation(value = "退款接口", notes = "退款接口")
    @PostMapping(value = "/getBillRefund")
    public DiDiRv getBillRefund(@ApiParam(name =
            "billRefundParam", value = "退款接口") @RequestBody BillRefundParam billRefundParam) {
        return customerServiceOperationService.getBillRefund(billRefundParam);
    }

    /**
     * 退款查询接口
     *
     * @param orderDetailParam
     * @return
     */
    @ApiOperation(value = "退款查询接口", notes = "退款查询接口")
    @PostMapping(value = "/getQueryRefund")
    public DiDiRv getQueryRefund(@ApiParam(name =
            "billRefundParam", value = "退款查询接口") OrderDetailParam orderDetailParam) {
        return customerServiceOperationService.getQueryRefund(orderDetailParam);
    }

}
